package com.tingyukeji.fastpay.user.activity;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.GridLayoutManager;
import android.view.View;

import com.tingyukeji.fastpay.R;
import com.tingyukeji.fastpay.base.BaseActivity;
import com.tingyukeji.fastpay.base.BaseRecyclerAdapter;
import com.tingyukeji.fastpay.databinding.BusinessRegistrationBankActivityBinding;
import com.tingyukeji.fastpay.user.adapter.SupportBankAdapter;
import com.tingyukeji.fastpay.view.MyGridLayoutManager;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2016/11/11.
 */

public class BusinessRegistrationBankActivity extends BaseActivity implements View.OnClickListener {
    private BusinessRegistrationBankActivityBinding binding;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    protected void setContentView() {
        super.setContentView();
        binding = DataBindingUtil.setContentView(this, R.layout.business_registration_bank_activity);
    }

    @Override
    protected void initView() {
        super.initView();
        initSupportBank();
        binding.btNext.setOnClickListener(this);
    }

    private void initSupportBank() {
        List<Integer> commList = new ArrayList<>();
        for (int i = 0; i < 6; i++) {
            commList.add(i);
        }
        MyGridLayoutManager gridLayoutManager = new MyGridLayoutManager(this,5, GridLayoutManager.VERTICAL,false);
        gridLayoutManager.setScrollEnabled(false);
        binding.supportBankRecyclerview.setLayoutManager(gridLayoutManager); //给RecyClerView 添加设置好的布局样式
        SupportBankAdapter supportBankAdapter = new SupportBankAdapter(commList,context,false); //初始化适配器
        binding.supportBankRecyclerview.setAdapter(supportBankAdapter); // 对 recyclerview 添加数据内容
        supportBankAdapter.setOnItemClickListener(new BaseRecyclerAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(View itemView, int pos) {
            }
        });
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.bt_next:
                goActivity(BusinessRegistrationPhoneActivity.class);
                break;
        }
    }

}
